<?php
/**
 * 验证
 * @author andery <andery@foxmail.com>
 * @link http://www.minophp.com/
 * @version $Id: CDateTime.lib.php 2010-07-08 23:12:10Z andery $
 */
class CValidate{
    
    /**
     * 验证邮箱格式
     */
    public static function is_email($email)
    {
        $chars = "/^([a-z0-9+_]|\\-|\\.)+@(([a-z0-9_]|\\-)+\\.)+[a-z]{2,5}\$/i";
        if (strpos($email, '@') !== false && strpos($email, '.') !== false) {
            if (preg_match($chars, $email)) {
                return true;
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
}